#ifndef __CHARGER_H__
#define __CHARGER_H__

#include "typedef.h"

#define WAIT_CHARGE_SEC 80 //等待启动完成界面倒计时时间

enum ChargeState{
    CSTATE_INIT = 0,   //初始化状态
    CSTATE_IDLE,       //空闲状态
    CSTATE_WAIT,       //等待状态
    CSTATE_CHARGE,     //充电中状态
    CSTATE_CHARGE_END, //充电结束状态
    CSTATE_SETTLE,     //结算状态
    CSTATE_ALARM,      //告警状态
    
    CSTATE_MAX
};

enum ChargeCmd{
	CCMD_INIT=0,
	CCMD_START,
	CCMD_STOP,
	CCMD_ALARM,
	CCMD_POLL,
	CCMD_CARD_SELECT,
	CCMD_CARD_SWIP,
	CCMD_GUI_RETURN,
	CCMD_GUN_STATE
};


int32_t charger_init(void);
int32_t charger_start_charge(int32_t gun_id, char_t *reasion);
int32_t charger_stop_charge_by_server(int32_t gun_id);
int32_t charger_stop_charge_by_user(int32_t gun_id);
int32_t charger_settle_set(uint8_t gun_id, uint32_t tcost);
int32_t charger_sync_time(uint64_t sec);
int32_t charger_sync_timedate(int year, uint8_t mon, uint8_t day, uint8_t hour, uint8_t min, uint8_t sec,uint8_t week);
void charger_print(void);

#endif

